package com.github.niefy.modules.wx.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.niefy.modules.wx.enums.CommonYesNoEnum;
import lombok.Data;
import lombok.Getter;

import java.io.Serializable;

@Data
@TableName("weibo_config")
public class WeiboConfig implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;
    @TableField(value = "wx_appid")
    private String wxAppId;
    @TableField(exist = false)
    private String wxName;
    @TableField(value = "user_type")
    private UserTypeEnum userType;
    @TableField(value = "call_weibo_flag")
    private CommonYesNoEnum callWeiBoFlag;
    /**
     * {@link CommonYesNoEnum}
     * */
    @TableField(value = "status")
    private String status;
    /**
     * {@link CommonYesNoEnum}
     * */
    @TableField(value = "del_flag")
    private String delFlag;

    @Getter
    public enum UserTypeEnum {

        /**
         *
         */
        NEW_USER("NEW_USER", "新用户"),
        /**
         *
         */
        ALL_USER("ALL_USER", "所有用户"),

        NEW_USER_2_THREE("NEW_USER_2_THREE", "新用户+3小时"),

        ;
        /**
         * 数据库属性值
         */
        private final String code;
        private final String msg;

        UserTypeEnum(String code, String msg) {
            this.code = code;
            this.msg = msg;
        }
    }

}
